import request from '@/utils/request'

// 获得列表
/* 
  @ param  any
     作为需要向后端传递的参数
     注意 get param
         post  body
*/
let getGuide = async (params) => {
    let result = await request({
        method: 'GET',
        url: '/guide/getGuideList',
        params: {
            ...params,
            role: "guide"
        }
    })
    return result
}

let delGuide = async (params) => {
    let result = await request({
        method: 'post',
        url: '/guide/delGuideById',
        data: {
            ...params,
            role: "guide"
        }
    })
    return result
}

let updateGuide = async (params) => {
    console.log(params);
    let result = await request({
        method: 'post',
        url: '/guide/updateGuide',
        data: {
            ...params,
            role: "guide"
        }
    })
    return result
}

let addGuide = async (params) => {
    console.log(params, "111");
    let result = await request({
        method: 'post',
        url: '/guide/addGuide',
        data: {
            ...params,
            role: "guide"
        }
    })
    return result
}

let findGuideByID = async (params) => {
    let result = await request({
        method: 'post',
        url: '/guide/getGuideListByID',
        data: {
            ...params,
            role: "guide"
        }
    })
    return result
}

let findGuideByAnthorID = async (params) => {
    let result = await request({
        method: 'post',
        url: '/guide/getGuideListByAnthorID',
        data: {
            ...params,
            role: "guide"
        }
    })
    return result
}

export default {
    getGuide,
    delGuide,
    updateGuide,
    addGuide,
    findGuideByID,
    findGuideByAnthorID
}